set memory 500m


log using "C:\Documents and Settings\Michael Horowitz\My Documents\WMD Paper\NuclearAgeJCRReplication.log", replace
use "C:\Documents and Settings\Michael Horowitz\My Documents\WMD Paper\JCRNuclearAgeReplication.dta", clear


*/Table 1 */


*/Model 1 */
logit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage  cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


*/ Model 2 Note - due to entry error by author, Side A Nuclear coefficient in paper appears as .158 instead of .156 */
logit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke Sdy sideAbof dem1 dem2 territory policy regimegovernment other cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


*/ Model 3 */
logit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke Sdy sideAbof dem1 dem2 territory policy regimegovernment other US Russia cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


*/ Figure 1 */
logit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke Sdy sideAbof dem1 dem2 territory regimegovernment policy other cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


postgr3 sideAnuclearage, x(sideAnuclear 1 sideBnuclear 0 sideBnuclearage 0 jointnuke 0) asis(sideAnuclearage) gen(sideAasymm) table2
graph save "C:\Documents and Settings\Michael Horowitz\My Documents\WMD Paper\sideAasymm.gph", replace
postgr3 sideBnuclearage, x(sideBnuclear 1 sideAnuclear 0 sideAnuclearage 0 jointnuke 0) asis(sideBnuclearage) gen(sideBasymm) table2
graph save "C:\Documents and Settings\Michael Horowitz\My Documents\WMD Paper\sideBasymm.gph", replace


twoway (line sideAasymm sideAnuclearage, sort lcolor(black) lpattern(solid) lwidth(medthick)) (line sideBasymm sideBnuclearage, sort lcolor(black) lpattern(dash) lwidth(medthick)), ytitle(Probability of Dispute Reciprocation, margin(medsmall)) ylabel(, grid glwidth(thin) glcolor(gray)) xtitle(Years of Nuclear Weapons Possession, margin(medsmall)) legend(label(1 "Only Side A Has Nuclear Weapons") labe(2 "Only Side B Has Nuclear Weapons") order(1 - " " 2)) name(Oct152008Figure1, replace) graphregion(fcolor(white) lcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ilcolor(white))


*/ Table 2 */
estsimp logit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage sideAbof Sdy dem1 dem2 cwpceyrs1 cwpceyrs2 cwpceyrs3 territory regimegovernment policy if year>1945 & cwrevt12==0 & cwrevt11>0, robust


*/ Young = p5 Medium = mean High = p95 */


*/Generating  mean */
setx mean
simqi, pr genpr(mean)


*/no nukes */
setx sideAnuclear 0 
setx sideBnuclear 0
setx sideAnuclearage 0
setx sideBnuclearage 0
simqi, pr genpr(nonukes)


*/ side A young, middle, old + side B no nukes */
setx sideAnuclear 1
setx sideAnuclearage 3
simqi, pr genpr(sideAyoung)
setx sideAnuclearage 25.3
simqi, pr genpr(sideAmedium)
setx sideAnuclearage 51
simqi, pr genpr(sideAold)


*/ reset */
setx mean
setx sideAnuclear 0 
setx sideBnuclear 0
setx sideAnuclearage 0
setx sideBnuclearage 0
simqi, pr genpr(nonukes2)


*/ side B young, middle, old + side A no nukes */
setx sideBnuclear 1
setx sideBnuclearage 1
simqi, pr genpr(sideByoung)
setx sideBnuclearage 23.6
simqi, pr genpr(sideBmedium)
setx sideBnuclearage 51
simqi, pr genpr(sideBold)


*/ reset */
setx mean
setx sideAnuclear 0 
setx sideBnuclear 0
setx sideAnuclearage 0
setx sideBnuclearage 0
simqi, pr genpr(nonukes3)


*/ side A + B vary together */
setx sideAnuclear 1
setx sideBnuclear 1
setx sideAnuclearage 3
setx sideBnuclearage 1
simqi, pr genpr(bothyoung)
setx sideAnuclearage 10.5
setx sideBnuclearage 12
simqi, pr genpr(bothlowmed)
setx sideAnuclearage 25.3
setx sideBnuclearage 23.6
simqi, pr genpr(bothmedium)
setx sideAnuclearage 51
setx sideBnuclearage 51
simqi, pr genpr(bothold)


*/ reset */
setx mean
setx sideAnuclear 0 
setx sideBnuclear 0
setx sideAnuclearage 0
setx sideBnuclearage 0
simqi, pr genpr(nonukes4)


*/ young/old distinctions*/
setx sideAnuclear 1
setx sideBnuclear 1
setx sideAnuclearage 25.3
setx sideBnuclearage 1
simqi, pr genpr(sideAmedByoung)
setx sideAnuclearage 3
setx sideBnuclearage 23.6
simqi, pr genpr(sideBmedAyoung)
setx sideAnuclearage 51
setx sideBnuclearage 23.6
simqi, pr genpr(sideAoldBmed)
setx sideAnuclearage 25.3
setx sideBnuclearage 51
simqi, pr genpr(sideBoldAmed)
setx sideAnuclearage 3
setx sideBnuclearage 51
simqi, pr genpr(sideBoldAyoung)
setx sideAnuclearage 51
setx sideBnuclearage 1
simqi, pr genpr(sideAoldByoung)


tabstat nonukes nonukes2 nonukes3 nonukes4 sideAyoung sideAmedium sideAold sideByoung sideBmedium sideBold bothyoung bothlowmed bothmedium bothold sideAmedByoung sideBmedAyoung sideAoldBmed sideBoldAmed sideBoldAyoung sideAoldByoung, stats(mean q sd)


*/ Simple math from output to generate relative risks and odds ratio.  Relative risk equation: ((First Difference)/(1-p(x))*/


clear


*/ Table 3 */
use "C:\Documents and Settings\Michael Horowitz\My Documents\WMD Paper\Table3Replication.dta", clear


*/ Model 1 */
probit initiation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage sideAbof Sdy dem1 dem2 cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


*/ Model 2 */
probit initiation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage sideAbof Sdy dem1 dem2 jointnuke US Russia cwpceyrs1 cwpceyrs2 cwpceyrs3, robust


*/ Model 3 -- Note: Used BdM tau-b satisfaction data rather than Signorino/Ritter S data */
heckprob reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke sideAbof dem1 dem2 cwpceyrs1 cwpceyrs2 cwpceyrs3, select(initiation = sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke sideAbof satisdy dem1 dem2 cwpceyrs1 cwpceyrs2 cwpceyrs3)


*/ Model 4 */
probit reciprocation sideAnuclear sideBnuclear sideAnuclearage sideBnuclearage jointnuke2 sideAbof Sdy dem1 dem2 cwpceyrs1 cwpceyrs2 cwpceyrs3 territory regimegovernment policy USb Russiab if cwrevt12==0 & (cwrevt11>=1 & cwrevt11<=4) & initiation==1, robust


log close